package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "demand_", schema = "boot", catalog = "")
public class Demand {//客户需求
    private int demandId;//需求id
    private String demandName;//需求主题
    private String demandContent;//需求内容
    private String demandMan;//需求提供人
    private Date demandDate;//记录时间
    private Integer demandSc;//删除状态
    private Sales sales;//销售机会id
    private Degree degree;//重要程度id
    private Kehu kehu;//客户id

    @Id
    @Column(name = "demand_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getDemandId() {
        return demandId;
    }

    public void setDemandId(int demandId) {
        this.demandId = demandId;
    }

    @Basic
    @Column(name = "demand_name", nullable = true, length = 200)
    public String getDemandName() {
        return demandName;
    }

    public void setDemandName(String demandName) {
        this.demandName = demandName;
    }

    @Basic
    @Column(name = "demand_content", nullable = true, length = 200)
    public String getDemandContent() {
        return demandContent;
    }

    public void setDemandContent(String demandContent) {
        this.demandContent = demandContent;
    }

    @Basic
    @Column(name = "demand_man", nullable = true, length = 200)
    public String getDemandMan() {
        return demandMan;
    }

    public void setDemandMan(String demandMan) {
        this.demandMan = demandMan;
    }

    @Basic
    @Column(name = "demand_date", nullable = true)
    public Date getDemandDate() {
        return demandDate;
    }

    public void setDemandDate(Date demandDate) {
        this.demandDate = demandDate;
    }

    @Basic
    @Column(name = "demand_sc", nullable = true,length = 11)
    public Integer getDemandSc() {
        return demandSc;
    }

    public void setDemandSc(Integer demandSc) {
        this.demandSc = demandSc;
    }

    @ManyToOne
    @JoinColumn(name = "degree_id", referencedColumnName = "degree_id")
    public Degree getDegree() {
        return degree;
    }

    public void setDegree(Degree degree) {
        this.degree = degree;
    }
    @ManyToOne
    @JoinColumn(name = "sales_id", referencedColumnName = "sales_id")
    public Sales getSales() {
        return sales;
    }

    public void setSales(Sales sales) {
        this.sales = sales;
    }
    @ManyToOne
    @JoinColumn(name = "k_id", referencedColumnName = "k_id")
    public Kehu getKehu() {
        return kehu;
    }

    public void setKehu(Kehu kehu) {
        this.kehu = kehu;
    }

    @Override
    public String toString() {
        return "Demand{" +
                "demandId=" + demandId +
                ", demandName='" + demandName + '\'' +
                ", demandContent='" + demandContent + '\'' +
                ", demandMan='" + demandMan + '\'' +
                ", demandDate=" + demandDate +
                ", demandSc=" + demandSc +
                ", sales=" + sales +
                ", degree=" + degree +
                ", kehu=" + kehu +
                '}';
    }
}
